package com.qianbao.finance.sync.modules.elasticsearch.websocket.server;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;

/**
 * 单实例,ShareConfig固定加载config/websocket.properties文件
 * 
 * @author WangYuan
 * @date 2016年7月12日下午3:25:15
 */
@Service
@PropertySource("classpath:/config/websocket.properties")
@ConfigurationProperties
public class ShareConfig {

    private boolean running = false; // 服务程序是否运行，用户控制定时器是否结束

    private int port; // 服务器监听端口

    private int threadPool; // 线程池数量

    private long connTimeout; // 心跳超时

    private int simulatorPort; // 接收监控数据端口

    private long connClearPeriod; // 连接清理定时器

    private String zabbixApiUrl; // Zabbix Server地址

    private String subscriberAddress; // Socket订阅地址

    public boolean isRunning() {
        return running;
    }

    public void setRunning(boolean running) {
        this.running = running;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getThreadPool() {
        return threadPool;
    }

    public void setThreadPool(int threadPool) {
        this.threadPool = threadPool;
    }

    public String getSubscriberAddress() {
        return subscriberAddress;
    }

    public long getConnTimeout() {
        return connTimeout;
    }

    public void setConnTimeout(long connTimeout) {
        this.connTimeout = connTimeout;
    }

    public long getConnClearPeriod() {
        return connClearPeriod;
    }

    public void setConnClearPeriod(long connClearPeriod) {
        this.connClearPeriod = connClearPeriod;
    }

    public void setSubscriberAddress(String subscriberAddress) {
        this.subscriberAddress = subscriberAddress;
    }

    public int getSimulatorPort() {
        return simulatorPort;
    }

    public void setSimulatorPort(int simulatorPort) {
        this.simulatorPort = simulatorPort;
    }

    public String getZabbixApiUrl() {
        return zabbixApiUrl;
    }

    public void setZabbixApiUrl(String zabbixApiUrl) {
        this.zabbixApiUrl = zabbixApiUrl;
    }

}
